<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:rich="http://richfaces.org/rich">

    <h:head>
        <title>Goalkeeper E-Shop</title>
        <h:outputStylesheet library="css" name="style.css" />
    </h:head>
    <h:body>   

        <f:view locale="#{languageBean.currentLocale}">
            <div id="background">
                <br/><br/><br/>
                <table id="table" align="center" width="75%">
                    <tr>
                        <td align="center" width="25%"><h:graphicImage library="img" name="logo.jpg" /></td>
                        <td align="center" width="75%"><h:graphicImage library="img" name="banner.jpg" /></td>
                    </tr>
                    <tr>
                        <td valign="top">
                            <h:form>
                                <h:panelGrid columns="1" width="100%">                                    
                                    <br/>                                                                                                   
                                    <h:panelGrid columns="2">
                                        <h:outputText styleClass="h2" value="#{msg.user}" />
                                        <h:outputText styleClass="h2" value="#{sessionBean.username}" />
                                    </h:panelGrid>
                                    <hr/>
                                    <br/>                                                                        
                                    <h:panelGrid styleClass="vertical-menu-cell" columnClasses="optionList" columns="1" cellspacing="0" cellpadding="0">
                                        <rich:dropDownMenu rendered="#{sessionBean.isAdmin}" label="#{msg.product}" mode="server" jointPoint="topRight" direction="bottomRight" style="border:1px solid #00cc00">
                                            <rich:menuItem action="#{menuBacking.overview}" label="#{msg.overviewProduct}">
                                                <f:facet name="icon">
                                                    <h:graphicImage library="img" name="overview.jpg" />
                                                </f:facet>
                                            </rich:menuItem>
                                            <rich:menuItem action="#{menuBacking.insert}" label="#{msg.insertProduct}">
                                                <f:facet name="icon">
                                                    <h:graphicImage library="img" name="insert.jpg" />
                                                </f:facet>
                                            </rich:menuItem>
                                            <rich:menuItem action="#{menuBacking.update}" label="#{msg.updateProduct}">
                                                <f:facet name="icon">
                                                    <h:graphicImage library="img" name="update.jpg" />
                                                </f:facet>
                                            </rich:menuItem>
                                            <rich:menuItem action="#{menuBacking.delete}" label="#{msg.deleteProduct}">
                                                <f:facet name="icon">
                                                    <h:graphicImage library="img" name="delete.jpg" />
                                                </f:facet>
                                            </rich:menuItem>
                                            <rich:menuItem action="#{menuBacking.upload}" label="#{msg.uploadImage}">
                                                <f:facet name="icon">
                                                    <h:graphicImage library="img" name="upload.jpg" />
                                                </f:facet>
                                            </rich:menuItem> 
                                        </rich:dropDownMenu>
                                        <rich:dropDownMenu label="#{msg.shopping}" mode="server" jointPoint="topRight" direction="bottomRight" style="border:1px solid #00cc00">
                                            <rich:menuItem action="#{menuBacking.shopping}" label="#{msg.shoppingOverview}">
                                                <f:facet name="icon">
                                                    <h:graphicImage library="img" name="overview.jpg" />
                                                </f:facet>
                                            </rich:menuItem>
                                            <rich:menuItem action="#{menuBacking.shoppingCart}" label="#{msg.shoppingCart}">
                                                <f:facet name="icon">
                                                    <h:graphicImage library="img" name="shop.jpg" />
                                                </f:facet>
                                            </rich:menuItem>
                                        </rich:dropDownMenu>
                                        <rich:dropDownMenu label="#{msg.language}" mode="server" jointPoint="topRight" direction="bottomRight" style="border:1px solid #00cc00">
                                            <rich:menuItem action="#{languageBean.changeLocale('de_DE')}" label="#{msg.german}">
                                                <f:facet name="icon">
                                                    <h:graphicImage library="img" name="german.jpg" />
                                                </f:facet>
                                            </rich:menuItem>
                                            <rich:menuItem action="#{languageBean.changeLocale('en')}" label="#{msg.english}">
                                                <f:facet name="icon">
                                                    <h:graphicImage library="img" name="english.jpg" />
                                                </f:facet>
                                            </rich:menuItem>
                                        </rich:dropDownMenu>
                                        <rich:dropDownMenu label="#{msg.logout}" mode="server" jointPoint="topRight" direction="bottomRight" style="border:1px solid #00cc00">
                                            <rich:menuItem action="#{logoutBacking.logout}" label="#{msg.logout}">
                                                <f:facet name="icon">
                                                    <h:graphicImage library="img" name="logout.jpg" />
                                                </f:facet>
                                            </rich:menuItem>
                                        </rich:dropDownMenu>
                                    </h:panelGrid>                                  
                                    <br/>
                                    <br/>
                                    <br/>
                                </h:panelGrid>
                            </h:form>
                        </td>
                        <td align="center" valign="top"><ui:insert name="content"></ui:insert></td>
                    </tr>            
                </table>
                <br/><br/><br/>
            </div>
        </f:view>

    </h:body>
</html>
